-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more TS tests for pallet-xcm precompile #3107
Conversation
WASM runtime size check:Compared to target branchMoonbase runtime: 2276 KB (no changes) ✅ Moonbeam runtime: 2248 KB (no changes) ✅ Moonriver runtime: 2244 KB (no changes) ✅ Compared to latest release (runtime-3400)Moonbase runtime: 2276 KB (+248 KB compared to latest release) Moonbeam runtime: 2248 KB (+236 KB compared to latest release) Moonriver runtime: 2244 KB (+232 KB compared to latest release) |
Coverage Report@@ Coverage Diff @@
## master agustin-xcm-precompile-tests +/- ##
===============================================================
Coverage 74.49% 74.49% 0.00%
Files 375 375
Lines 95313 95313
===============================================================
Hits 70998 70998
Misses 24315 24315
|
test/suites/dev/moonbase/test-precompile/test-precompile-pallet-xcm-2.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use the new native foreign assets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just added a suggestion, but looks great!
test/suites/dev/moonbase/test-precompile/test-precompile-pallet-xcm-2.ts
Show resolved
Hide resolved
test/suites/dev/moonbase/test-precompile/test-precompile-pallet-xcm-2.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
.polkadotJs() | ||
.tx.sudo.sudo(mockHrmpChannelExistanceTx(context, destinationPara, 1000, 102400, 102400)); | ||
|
||
const alithNonce = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to manually fetch Alith's current nonce? The test runs correctly without passing the nonce to createThersTransaction
.
functionName: "transferAssetsToPara20", | ||
}), | ||
gasLimit: 500_000n, | ||
nonce: alithNonce, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the previous comment
[await foreignParaAssetContract.getAddress(), amountToSend], | ||
]; | ||
|
||
const mockHrmp1000Tx = context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we mock the channel once at beforeAll
instead of every case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, but left some comments.
Edit: Got merged just before writing this
What does it do?
Adds extra typescript tests for pallet-xcm precompile. The new tests mostly check the behavior at the moment of combining two assets, and also using the origin's chain native token to pay for fees.